<%@page import="java.util.*" %>
<%@page import="autenticacion.Capa_Presentacion.frmLogin"%>
<%
    String html="";
    String p_class  = request.getParameter("class");
    /*Enumeration enu = request.getParameterNames();
    while (enu.hasMoreElements()){
        out.print(enu.nextElement().toString());
    }*/
    String p_type    = request.getParameter("type");
    if (p_class.equals("login")){
        if (p_type.equals("show")){
            frmLogin frm = new frmLogin();
            html = frm.show();
        }
        else if (p_type.equals("validate")){
            String user = request.getParameter("user");
            String pass = request.getParameter("pass");
            frmLogin frm = new frmLogin();
            if (frm.validarUsuario_control(user, pass)){
                session.setAttribute("user", frm.ide_usuario);
                session.setAttribute("perfil", frm.ide_perfil);
                session.setAttribute("name", frm.nom_usuario);
                html="";
                html+=frm.nom_usuario+"%";
                html+=frm.getMenu();
            }
            else{
                html="nologin";
            }
        }
    }
    out.print(html);
    //out.print("nologin");
%>